package org.rambadger.command.event;


import com.google.common.base.Objects;
import org.hibernate.validator.constraints.NotEmpty;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

public class UserPasswordChanged implements Serializable {

    private final String username;
    private final String newPasswordHash;

    public UserPasswordChanged(String username, String newPasswordHash) {
        this.username = username;
        this.newPasswordHash = newPasswordHash;
    }

    @UrlIdentifier @NotNull
    public String getUsername() {
        return username;
    }

    @NotEmpty
    public String getNewPasswordHash() {
        return newPasswordHash;
    }

    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("username", username)
                .add("newPasswordHash", newPasswordHash)
                .toString();
    }
}
